package com.tianlh.service.design_pattern.Decorator;

/**
 * Created by wb-tianlihui on 2017/11/21.
 */
public class Main {
    public static void main(String[] args) {

        //首先创建需要被装饰的原始对象(即要被装饰的对象)
        HeroComponent c1 = new TimorComponent();
        //给对象增加Q技能
        Decorator decoratorQ = new QDecorator(c1);
        //Q技能的基础上，增加W技能
        Decorator decoratorW = new WDecorator(decoratorQ);
        //W技能的基础上，增加E技能
        Decorator decoratorE = new EDecorator(decoratorW);
        //E技能的基础上，增加R技能
        Decorator decoratorR = new RDecorator(decoratorE);

        decoratorR.Pugong();
    }
}
